
/*******************************************************************************
* company    : 六瓜编程 2010-2020
* description: 
* date: 2020-12-10 00:20:16
* author : XiaoShengYang
*******************************************************************************/

#ifndef __LG_TYPES_H
#define __LG_TYPES_H
#include <stdbool.h>

#define lg_false 0
#define lg_true  1
#ifndef NULL
#define NULL 0
#endif /* NULL */

typedef bool lg_bool;
typedef void lg_void;
typedef unsigned int lg_u32;
typedef int lg_s32;
typedef unsigned short lg_u16;
typedef short lg_s16;
typedef unsigned char lg_u8;
typedef char lg_s8;

#define lg_reg_write(addr, val)   (*(volatile unsigned int *)(uintprt_t)(addr) = (val))
#define lg_reg_read(addr, val)    ((val) = *(volatile unsigned int *)(uintprt_t)(addr))
#define lg_reg_write32(addr, val) (*(volatile unsigned int *)(uintprt_t)(addr) = (val))
#define lg_reg_read32(addr, val)  ((val) = *(volatile unsigned int *)(uintprt_t)(addr))
#endif